package z.sample.persistence.dao;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional;

import z.sample.persistence.entity.Customer;

@Transactional
public interface CustomerDao extends JpaRepository<Customer, Long>, JpaSpecificationExecutor<Customer> {
	@Query(value = "SELECT c.* FROM customers c WHERE c.customerName like %:name%", nativeQuery = true)
	public List<Customer> findByName(@Param("name") String name);
}
